package net.sky.oa.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *物品申请表
 *FloGoodsapply. @author hond
 */
@Entity
@Table(name = "FLO_GOODSAPPLY")//物品申请表
public class FloGoodsapply {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	private Long id;
	private String title;   //物品申请标题
	private Integer type;      //申请类型
	private Date applytime; //申请时间
	private Date expecttime;//到位时间
	private Integer rank;      //紧要程度：1是2否
	private String reason;  //申请理由
	private Integer status;    //状态
	private SysEmployee user; //用户id
	private SysDept dept;   //部门id

	// Constructors

	/** default constructor */
	public FloGoodsapply() {
	}

	/** minimal constructor */
	public FloGoodsapply(Long id) {
		this.id = id;
	}
	
	@Id 
	@SequenceGenerator(name="SQ_FLOGOODSAPPLY_ID",sequenceName="SQ_FLOGOODSAPPLY_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_FLOGOODSAPPLY_ID")
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "TITLE", length = 60)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	@Column(name = "TYPE", precision = 2, scale = 0)
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "APPLYTIME", length = 7)
	public Date getApplytime() {
		return this.applytime;
	}

	public void setApplytime(Date applytime) {
		this.applytime = applytime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "EXPECTTIME", length = 7)
	public Date getExpecttime() {
		return this.expecttime;
	}

	public void setExpecttime(Date expecttime) {
		this.expecttime = expecttime;
	}
	@Column(name = "RANK", precision = 2, scale = 0)
	public Integer getRank() {
		return rank;
	}

	public void setRank(Integer rank) {
		this.rank = rank;
	}

	

	@Column(name = "REASON", length = 100)
	public String getReason() {
		return this.reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}
	@Column(name = "STATUS", precision = 2, scale = 0)
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return this.user;
	}

	public void setUser(SysEmployee user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DEPT_ID")
	public SysDept getDept() {
		return this.dept;
	}

	public void setDept(SysDept dept) {
		this.dept = dept;
	}

}